import { createRouter, createWebHistory } from "vue-router";

import Layout from "../views/layout/index.vue";

export const routes = [
  {
    path: "/login",
    name: "login",
    label: "登录",
    hidden: true,
    component: () => import("../views/login/index.vue"),
  },
  {
    path: "/",
    name: "home",
    label: "首页",
    component: Layout,
  },
  {
    path: "/user",
    name: "user",
    label: "用户管理",
    component: Layout,
    children: [
      {
        path: "student-list",
        name: "student-list",
        label: "学生管理",
        component: () => import("../views/user/student/index.vue"),
      },
      {
        path: "teacher-list",
        name: "teacher-list",
        label: "教师管理",
        component: () => import("../views/user/teacher/index.vue"),
        children: [
          {
            path: "teacher-add",
            name: "teacher-add",
            label: "新增教师",
            component: () => import("../views/user/teacher/add.vue"),
          },
        ],
      },
    ],
  },
];
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
